fix(build): restore compatibility with JDK11+ - #84
Conversation
…oundError on Java 9+ The 1.3.5-1.3.7 releases moved the release build from JDK 11 to JDK 8, which silently broke the published jar in two ways: * module-info.class was no longer compiled and no Automatic-Module-Name was set, so the module name degraded from io.questdb.client to the filename-derived questdb.client. * only the src/main/java8 FdBig bridge (sun.misc.FDBigInteger) was packaged; sun.misc.FDBigInteger does not exist on Java 9+, so slow-path double formatting (e.g. doubleColumn with extreme-exponent values) died with NoClassDefFoundError: sun/misc/FDBigInteger. Fix, keeping JDK 8 as the release build JDK: * pin Automatic-Module-Name: io.questdb.client in the jar manifest * package the src/main/java11 bridge (jdk.internal.math.FDBigInteger) into META-INF/versions/11 and mark the jar Multi-Release: true; JDK 8 builds compile it with a JDK 11+ from JAVA11_HOME (build fails fast if unset, instead of shipping a broken jar) * JarPackagingIT (failsafe) asserts the packaged jar's manifest, MRJAR layout, and FdBig linkage, and executes slow-path double formatting against the jar in a child JVM - regressions that unit tests cannot see because they run against target/classes * new CI job runs the JDK 8-built jar on JDK 25: checks the derived module name and the double-formatting smoke (DoubleFormatSmoke) * enforcer refuses mvn deploy -P maven-central-publish on a non-JDK 8 build, whose jar root would break Java 8 consumers Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the hard-coded two-file javac invocation with a whole-directory ant <javac>, so a file added to src/main/java11 cannot silently ship without its versions/11 counterpart. JarPackagingIT now also cross-checks every source in src/main/java11 against the packaged jar. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JarPackagingIT ran DoubleFormatSmoke only on the build JDK, so on JDK 8 builds -- including the release verify gate -- the META-INF/versions/11 classes were validated structurally but never executed; the only executable proof lived in the CI smoke job, which never sees the release-built jar. The IT now spawns a second child JVM from JAVA11_HOME (always present during JDK 8 packaging) so the versioned bridge is run against the exact jar being shipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
I've verified the full chain. Here's my review. PR #84 Review —
|
Fix crash on Java 11+ and module name regression introduced in 1.3.5
Who is affected: anyone using questdb-client 1.3.5 - 1.3.7 on Java 11 or newer, and anyone referencing the client from the module path.
Impact:
NoClassDefFoundError: sun/misc/FDBigInteger. Java 8 users are not affected.io.questdb.clienttoquestdb.client, breaking module-path consumers on upgrade.This PR restores the module name and packages the jar so double formatting works on Java 8 and on Java 11 and newer. Java 9 and 10 (long-EOL, non-LTS) remain unsupported, as in every release since 1.3.4.